Skip to content

Conversation

@mcous
Copy link
Owner

@mcous mcous commented Feb 5, 2026

Allow individual tests to opt-into the v3 API via swapping the type annotation on the decoy fixture

- from decoy import Decoy
+ from decoy.next import Decoy

  def test_when(decoy: Decoy) -> None:
      mock = decoy.mock(cls=SomeClass)
-     decoy.when(mock.foo("hello")).then_return("world")
+     decoy.when(mock.foo).called_with("hello").then_return("world")

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (74b7e4f) to head (156f146).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #321   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines         1533      1540    +7     
  Branches       191       192    +1     
=========================================
+ Hits          1533      1540    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mcous mcous force-pushed the feat/pytest-plugin-v3-opt-in branch 4 times, most recently from aea0452 to 68280f6 Compare February 5, 2026 16:27
@mcous mcous force-pushed the feat/pytest-plugin-v3-opt-in branch from 68280f6 to 156f146 Compare February 5, 2026 16:28
@mcous mcous changed the title feat(pytest): use v3 API in decoy fixture if annotated feat(pytest-plugin): use decoy.next API in fixture if annotated Feb 5, 2026
@mcous mcous merged commit 5a0d2a0 into main Feb 5, 2026
17 checks passed
@mcous mcous deleted the feat/pytest-plugin-v3-opt-in branch February 5, 2026 17:42
@mcous mcous mentioned this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant